package nextee.cabletest.protocol;

/**
 * Created by Administrator on 2015/4/27.
 */
public class ProtocolData {
    public int   voltage = 0;
    public int   current = 0;
    public byte  channel = 0;
    public byte  position= 0;

    public ProtocolData(byte[] data){
        voltage = (data[0]&0xff)*0x100 + (data[1]&0xff);
        current = (data[2]&0xff)*0x100 + (data[3]&0xff);
        channel = data[4];
        position= data[5];
    }

    public ProtocolData(){

    }

    public void debug(){
        String temp = String.format("voltage: %d current: %d channel: %d position: %d", voltage, current, channel, position);
        System.out.println(temp);
    }
}
